#ifndef __UART_H__
#define __UART_H__
#include "main.h"
#include "stdarg.h"

typedef void (*WriteFun_t)(uint8_t *pBuf, uint32_t length);
typedef uint16_t (*ReadFun_t)(uint8_t *pBuf);
typedef void (*PrintFun_t)(const char *fmt, ...);
typedef struct {
	bool recvFlag;
	WriteFun_t write;
	ReadFun_t read;
	PrintFun_t print;
}uartStruct_t;

#define UART1_BUF_SIZE 256
extern uartStruct_t devUART1;
void USART1_Init(uint32_t BaudRate);

#define UART2_BUF_SIZE 256
extern uartStruct_t devUART2;
void USART2_Init(uint32_t BaudRate);

#define UART3_BUF_SIZE 256
extern uartStruct_t devUART3;
void USART3_Init(uint32_t BaudRate);

#define UART4_BUF_SIZE 256
extern uartStruct_t devUART4;
void UART4_Init(uint32_t BaudRate);

#define UART6_BUF_SIZE 256
extern uartStruct_t devUART6;
void USART6_Init(uint32_t BaudRate);
#endif

